package com.imcode.exceptiondemo;

import java.io.FileNotFoundException;

public class ExceptionDemo01 {

    public static void main(String[] args) throws FileNotFoundException {
        System.out.println("抛出异常");

        //NullPointerException e = new NullPointerException("抛出空指针异常");
        //System.out.println(e.getMessage());
        //System.out.println(e.printStackTrace());

        // 抛出异常
        //throw new NullPointerException("抛出空指针异常");// 运行期异常
        //System.out.println();

        throw new FileNotFoundException("找不到文件"); // 编译期异常 需要在编译阶段处理
    }
}
